<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="UTF-8"%>
<%@ page import="java.util.*,swimv2gm.bl.domain.Ability"%>
<!DOCTYPE html>
<html>
<head>
<title>SWIMv2: Dichiara competenze</title>
<link rel="stylesheet" type="text/css"
	href="/SWIMv2gm/shared/global.css" />
</head>
<body>
	<div id="header">
		<h1>SWIMv2</h1>
	</div>
	<%@include file="/shared/menu.jsp"%>
	<div id="content">
		<h1>Aggiunta competenze</h1>

		<%
			if (request.getParameter("error") != null && "noselection".equalsIgnoreCase(request.getParameter("error"))) {
		%><p class="errorbox">Selezionare almeno una competenza.</p>
		<%
			}
		%>

		<p>Selezionare una o più delle competenze seguenti.</p>

		<%
			List<Ability> abilities = ((List<Ability>)request.getAttribute("list"));

			if (abilities == null || abilities.size() == 0) {
		%>
		<p class="message">Non sono presenti competenze da inserire.</p>
		<%
			}
			else {
		%>
		<form action="/SWIMv2gm/user/AddAbility" method="post">
			<dl>
				<%
					for (Ability a:abilities) {
				%>
				<dt>
					<input name="cid" value="<%=a.getId()%>" type="checkbox" /><label
						for="<%=a.getId()%>"><%=a.getNome()%></label>
				</dt>
				<dd><%=a.getDescrizione()%></dd>
				<%
					}
				%>
			</dl>
			<input type="submit" value="Aggiungi competenze" />
		</form>
		<%
			}
		%>
	</div>
</body>
</html>